Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

137
Views
Using dateFormat library to convert as "en-gb"

Is there a way to convert following date which is in "en-US" time for "en-GB" time format using npm dateFormat library.I'm trying this to prevent showing 24:00 as 00:00.

var date = new DateTime(dt - 36000000)
date = dateFormat(date, "HH:mm")
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Javascript treats 24:00 as 00:00.

00:00 is the standard format.

However, if you have a specific requirement of showing it as 24:00. You can simply replace:

import dateFormat from "dateformat";
let date = new Date("2022-03-04 24:00");
date = dateFormat(date, "HH:mm").replace("00:", "24:")
console.log(date);
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!